from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError


# 审批流类
class Workflow(models.Model):
    _inherit = 'sb.workflow'

    sale_change_id = fields.Many2one('sb.sale.change', string="Related Documents", ondelete="cascade")
    workflow_type = fields.Selection(selection_add=[
        ('sale_change', 'Sale Change'),
        ('link_delink', 'Link/Delink'),
    ], ondelete={'activity': 'cascade'})
    link_id = fields.Many2one('sb.sale.link.mo', string="Related Documents", ondelete="cascade")
